import request from '@/utils/request'
/**
 * 添加流程定义
 * @param {*} data
 */
export function save(data) {
  return request({
    url: '/wf/process/save',
    method: 'post',
    data
  })
}
/**
 * 修改流程定义
 * @param {*} data
 */
export function update(data) {
  return request({
    url: '/wf/process/update',
    method: 'post',
    data
  })
}
/**
 * 删除流程定义
 * @param {*} data
 */
export function remove(data) {
  return request({
    url: '/wf/process/remove',
    method: 'post',
    data
  })
}
/**
 * 通过id获取流程定义
 * @param {*} data
 */
export function get(data) {
  return request({
    url: '/wf/process/get',
    method: 'post',
    data
  })
}
/**
 * 分页查询流程定义列表
 * @param {*} data
 */
export function list(data) {
  return request({
    url: '/wf/process/list',
    method: 'post',
    data
  })
}
/**
 * 流程部署
 * @param {*} data
 */
export function deploy(data) {
  return request({
    url: '/wf/process/deploy',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/xml'
    }
  })
}
/**
 * 重新流程部署
 * @param {*} data
 */
export function redeploy(id, data) {
  return request({
    url: `/wf/process/redeploy?id=${id}`,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/xml'
    }
  })
}
/**
 * 流程定义xml
 * @param {*} data
 */
export function getXml(data) {
  return request({
    url: '/wf/process/getXml',
    method: 'post',
    data
  })
}
/**
 * 级联删除
 * @param {*} data
 */
export function cascadeRemove(data) {
  return request({
    url: '/wf/process/cascadeRemove',
    method: 'post',
    data
  })
}
